package com.chen.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chen.domain.Account;
import com.chen.dto.AccountDto;
import com.chen.model.SymbolAssetVo;
import com.chen.model.UserTotalAccountVo;

import java.math.BigDecimal;
import java.util.List;

public interface AccountService extends IService<Account>{


    Page<Account> findPageForList(Page<Account> page, Long userId, String userName, String mobile, Long coinId, String startAmount, String endAmount, Byte status);

    void transfer(Long coinFrom,
                  Long coinTo,
                  Long userFrom,
                  Long userTo,
                  Long orderId,
                  String businessType,
                  BigDecimal amount,
                  BigDecimal fee,
                  String remark);

    /**
     * 根据币种名称查询用户的账户
     * @param gcn
     * @return
     */
    Account findUserAccountByCoinName(Long coinId,String gcn,Long userId);

    /**
     * 获取一个交易对的余额
     * @param symbol
     * @return
     */
    SymbolAssetVo findSymbolAccount(String symbol);

    /**
     * 将用户的可用余额转入冻结余额
     * @param coinId
     * @param userId
     * @return
     */
    Boolean transferUserLock(Long coinId, Long userId,BigDecimal amount,Long orderId);

    /**
     * 查询用户的总资产
     * @return
     */
    UserTotalAccountVo findTotal();

    /**
     * 创建用户的账户信息
     * @param userId
     * @return
     */
    List<AccountDto> buildUserAccount(Long userId);
}
